<?php
class JoinToday extends CWidget
{
	public $postParams=array();
	public $config=array();
	
	public function run()
  	{?>
  		<?php

$model = new LoginForm;	
?>

<script type="text/javascript">
$(document).ready(function(){
 
    $(".signin_pop").hide();
    $(".join_today").show();
 
    $('#aaa').click(function(){
    $(".signin_pop").show('slow');
	 $(".join_today").hide('slow');
    });
	
	 $('#bbb').click(function(){
    $(".signin_pop").hide('slow');
	 $(".join_today").show('slow');
    });
 
});
</script>

<div class="signin_pop">
	<div class="spacer10">&nbsp;</div>
	<div class="fr mr10"><img id="bbb" style="cursor:pointer"  src="<?php echo ApplicationConfig::app()->params['base']['imageUrl']?>close.png"></a></div>
	<div class="spacer10 cl">&nbsp;</div>
	<!-- <form action="" method="post" id="signin"> --> 
	
	<?php $form=$this->beginWidget('CActiveForm', array(
		'id'=>'login-form',
	
		'enableClientValidation'=>true,
		'clientOptions'=>array(
		'validateOnSubmit'=>true,
		'enableAjaxValidation'=>true //turn on ajax validation on the client side
		),
		'htmlOptions'=>array('style'=>'margin-left: -7px;margin-top: -10px;'),
		));
	?>
		<div id="errorMessage" class="errorMessage" style="margin-top: -84px;overflow: hidden;height: 84px;display:none" ></div>
		<div class="fl ml20">
			<!-- <input type="text" AutoComplete="off" name="name" value="Name" onClick="if(this.value=='Name'){this.value=''}" onBlur="if(this.value==''){this.value='Name'}" class="pl15 input_txt wh" /> -->
			<?php //echo $form->labelEx($model,'username'); ?>
			<?php echo $form->textField($model,'username',array('class'=>'pl15 input_txt wh','value'=>"Name",'onClick'=>"if(this.value=='Name'){this.value=''}", 'onBlur'=>"if(this.value==''){this.value='Name'}")); ?>
			<?php echo $form->error($model,'username'); ?>
		</div>
		<div class="cl spacer15">&nbsp;</div>
		
		<div class="fl ml20">
			<!-- <input type="password" AutoComplete="off" name="password" value="Password" onClick="if(this.value=='Password'){this.value=''}" onBlur="if(this.value==''){this.value='Password'}" class="pl15 input_txt wh" /> -->
			<?php //echo $form->labelEx($model,'password'); ?>
			<?php echo $form->passwordField($model,'password',array('class'=>'pl15 input_txt wh','value'=>"Password", 'onClick'=>"if(this.value=='Password'){this.value=''}", 'onBlur'=>"if(this.value==''){this.value='Password'}")); ?>
			<?php echo $form->error($model,'password'); ?>
			
		</div>
		<div class="cl spacer10">&nbsp;</div>

		
		<div class="fl ml20">
			<!-- <a class="login_btn inblk" href=""><span class="wh login_txt fnt12 helv_black inblk">Sign in</span></a>-->
			<?php echo CHtml::ajaxSubmitButton('LOGIN', ApplicationConfig::getURL("","site","login"),array('success'=>'js: function(data) {
						if(data !="success"){
						$("#errorMessage").html(data);
						$("#errorMessage").show();}
						else
						window.location = "";
                       
                    }'),array('class'=>'login_btn inblk','span class'=>'wh login_txt fnt12 helv_black inblk',"style"=>"color: white;font-size: 14px;font-weight: bold;")); ?>
             <div style="margin-top: -35px;margin-left: 115px;">       
            <?php echo $form->checkBox($model,'rememberMe'); ?>
			<?php echo $form->label($model,'rememberMe'); ?>
			<?php echo $form->error($model,'rememberMe'); ?>
			</div>
		</div>
		
		<div class="fr mr16 pr35" style="width: 200px;margin-top: -3px;">
			<a class="wh" href="#" style="margin-left: 100px;">Forgot Password</a>
		</div>
		
		<div class="cl spacer10">&nbsp;</div>
		
		<?php $this->endWidget(); ?>
	<!-- </form> -->
</div>
<div class="join_today">
	<div class="its_free"></div>
	<div class="spacer50">&nbsp;</div>
	<div class="mt35">
	<div class="spacer50">&nbsp;</div>
		<div style="cursor:pointer" id="aaa" class="fl ml30 login_btn" ><span class="wh login_txt fnt12 helv_black inblk">Sign in</span></div>
		<div class="fl ml30"><a href="" class="login_btn inblk"><span class="wh login_txt fnt12 helv_black inblk">REGISTER</span></a></div>
		<div class="cl"></div>
	</div>
</div>
<script>
$(document).ready(function($) {		
	$("#bbb").click(function() {
	$("#errorMessage").html("");
	$("#errorMessage").hide();
	});

}); 
</script>
  		
  		
  	<?php }
}
?>  
 